<?php

class DefaultController extends FController
{
	public function actionIndex()
	{
		/*
        $model = new Products('search');
        if (isset($_GET['Products']))
            $model->attributes = $_GET['Products'];
		*/
		$criteria=new CDbCriteria(array(
			'condition'=>'is_published=1',
			'order'=>'created DESC',
		));

		$dataProvider=new CActiveDataProvider('Products', array(
			'pagination'=>array(
				'pageSize'=>21,
			),
			'criteria'=>$criteria,
		));
        $this->render('index', array(
            'dataProvider' => $dataProvider,
        ));
		//$this->render('index');
	}
}